#include <stdio.h>

#define FUNDLEN 50
#define N 2

struct funds {
    char bank[FUNDLEN];
    double bankfund;
    char save[FUNDLEN];
    double savefund;
};

double sum(const struct funds money[], int n);

int main(void) {
    struct funds jones[N] = {
            {
                    "Garlic-Melon Bank",
                    403218.13,
                    "Luck's Savings and Loan",
                    8568.4,
            },
            {
                    "Honest Jack's Bank",
                    34120.04,
                    "Party Time Savings",
                    39349.02,
            }
    };

    printf("The Joneses have a total of $%.2f.\n", sum(jones, N));

    return 0;
}

double sum(const struct funds money [], int n)
{
    double total;
    int i;

    for (i = 0, total = 0; i < n; i++)
        total += money[i].bankfund + money[i].savefund;

    return total;
}